<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>My JSP 'MyJsp.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
<jsp:include page="/scripts/common/index.html"></jsp:include>
<jsp:include page="/scripts/dhtmlx/index.html"></jsp:include>
<jsp:include page="/scripts/jquery/index.html"></jsp:include>
<jsp:include page="/scripts/bootstrap/index.html"></jsp:include>
<link rel="stylesheet" href="${basepath }style/default.css">
</head>
<script type="text/javascript">
console.debug("111111"+parent.query);
	function save(obj) {
		$.ajax({
				type : 'POST' ,
				url : '${basePath}page/workflow/countersign/Countersign/doSign' ,
				data : {
						"map.taskId" : "${act_form_taskId}" ,
						"map.status" : $("#status").val() ,
						"map.comment" : $("#comment").val() ,
						"map.title" : $("#title").val() ,
						"map.signatory" : $("#signatory").val()
				} ,
				dataType : "json" ,
				async : true ,
				cache : false ,
				jsonpCallback : "null" ,
				//beforeSend : function(response, status, statusText) {
				//alert(response + ":" + status + ":" + statusText);
				//} ,
				//dataFilter : function(response, status, statusText) {
				//alert(response + ":" + status + ":" + statusText);
				//} ,
				success : function(response, status, statusText) {
					//alert(response + ":" + status + ":" + statusText);
					if (response.status) {
						if (parent.query) {
							parent.query();
						}
						closeWindow();
					} else {
						alert(response.content);
					}
				} ,
				error : function(response, status, statusText) {
					//alert(response + ":" + status + ":" + statusText);
				} ,
				complete : function(response, status, statusText) {
					//alert(response + ":" + status + ":" + statusText);
				}
		});
	}
	function closeWindow() {
		parent.w1.close();
	}
</script>
<body>
	<form class="form-horizontal MyForm" id="MyForm" name="MyForm" method="post" target="MyFrame" enctype="multipart/form-data">
		<table class="contTable">
			<tr class="firstTr">
				<td>
					<jsp:include page="/common/WF_Toolbar_Deal.jsp">
						<jsp:param name="next_func" value="save" />
					</jsp:include>
				</td>
			</tr>
			<tr style="height:auto">
				<td valign="top">
					<div style="width:100%;height:230px;overflow-y:auto;">
						<div class="blockBorder">
							<div class="titleS">
								<strong>申请信息</strong>
							</div>
							<div class="tableCont" style="width: 90%;">
								<input id="guid" name="map.guid" type="hidden" class="form-control" value="${map.guid }">
								<div class="form-group">
									<label class="col-xs-3 control-label" for="name">申请编号:</label>
									<div class="col-xs-7">
										<input class="form-control" id="SignCode" name="map.SignCode" type="text" value="${map.SignCode }" readonly="readonly" />
									</div>
									<div class="col-xs-1">
										<span class="required">*</span>
									</div>
								</div>
								<div class="form-group">
									<label class="col-xs-3 control-label" for="name">申请原因:</label>
									<div class="col-xs-7">
										<textarea class="form-control" id="SignName" name="map.SignName"  placeholder="" rows="3" cols="">${map.SignName }</textarea>
									</div>
									<div class="col-xs-1">
										<span class="required">*</span>
									</div>
								</div>
								<div class="form-group">
									<label class="col-xs-3 control-label" for="name">申请人:</label>
									<div class="col-xs-7">
										<input class="form-control"  id="signatory" name="map.signatory" type="text" value="${map.signatory }" />
									</div>
									<div class="col-xs-1">
										<span class="required">*</span>
									</div>
								</div>
								
							</div>
						</div>
					</div>
				</td>
			</tr>
		</table>
	</form>
</body>
</html>
